package github.flandre.examplemod.core.init;

import github.flandre.examplemod.common.block.*;
import github.flandre.examplemod.common.tileentity.ExampleGuiTileEntity;
import github.flandre.examplemod.common.world.ExampleTree;
import github.flandre.examplemod.core.init.Itemgroup.ExampleGroup;
import github.flandre.examplemod.examplemod;
import net.minecraft.block.*;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialColor;
import net.minecraft.entity.EntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraftforge.client.model.obj.MaterialLibrary;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

public class BlockInit {
    public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, examplemod.MODID);

    //方块
//    public static final RegistryObject<ExampleBlock> EXAMPLE_BLOCK =
//            BLOCKS.register("example_block",ExampleBlock::new);

    public static final RegistryObject<ExampleDirectionBlock> EXAMPLE_DIRECTION_BLOCK =
            BLOCKS.register("example_direction_block",ExampleDirectionBlock::new);

    public static final RegistryObject<CustomBlock> CUSTOM_BLOCK =
            BLOCKS.register("custom_block",CustomBlock::new);

    public static final RegistryObject<luoliBlock> LUOLI_BLOCK =
            BLOCKS.register("luoli_block",luoliBlock::new);

    public static final RegistryObject<ExampleGuiBlock> EXAMPLE_GUI_BLOCK = BLOCKS.register("example_gui_block",ExampleGuiBlock::new);

    //木头和树叶
    public static final RegistryObject<Block> EXAMPLE_LOG =
            BLOCKS.register("example_log",()->new RotatedPillarBlock(AbstractBlock.Properties.from(Blocks.OAK_LOG)));

    public static final RegistryObject<Block> EXAMPLE_LEAVES =
            BLOCKS.register("example_leaves",()->new LeavesBlock(AbstractBlock.Properties.create(Material.LEAVES)
                    .hardnessAndResistance(0.2F)
                    .tickRandomly()
                    .sound(SoundType.PLANT)
                    .notSolid()));

    public static final RegistryObject<Block> EXAMPLE_SAPLING =
            BLOCKS.register("example_sapling",()->new SaplingBlock(new ExampleTree(),
                    AbstractBlock.Properties.from(Blocks.OAK_SAPLING)));




    //ExampleCropsBlock
    public static final RegistryObject<Block> EXAMPLE_CROPS =
            BLOCKS.register("example_crops",ExampleCropsBlock::new);






}





